<?php
header("content-type:text/html;charset=utf-8");
$link= new  PDO('mysql:host=127.0.0.1;dbname=1704phpA','root','');
$link->exec('set  names utf8');
$user_name="刘德华";//假设网站验证用户名唯一
$user_pwd=md5(123456);
$number=ord(hash('haval160,4',$user_name));//ord返回第一个字符串的ASCII
/*echo  $number;
die();
echo "<br/>";*/
$num= $number%4+1;
$sql="insert  into  user_0$num value(null,'$user_name','$user_pwd')";
$res=$link->exec($sql);
if($res){
    echo  "1";
}else{
    echo  "0";
}

